php forum
php mysql forum
php mysql smarty
 
Topic Options
#317806 - 02/12/09 05:37 AM [7.4.2] - UBB ImagePopper (incl. custom tag)
Kayjey Offline
Newbie

Registered: 07/25/02
Posts: 12
Loc: Belgium, Zele
Author: Kayjey (www.straydesign.com)
Version: v0.9 RC

About:
Big images can ruin the layout of a Forum. While loading, they also can cause the layout to shift. I've created this custom tag and linked popup that will display an image thumbnail (browser-resized) and links it to a large popup for that image.

Installation:
There's two parts to this.

Step 1
Download www.straydesign.com/customers/misc/ubb-imagepopup.zip

Unzip and upload the PHP file into your root 'forum' folder. (It does not need editing.)

Step 2
In the Forum Control Panel, go to 'content rebuilder', tab 'custom tags' and create a new 'custom tag'

Enabled = yes
Show in menu = probably yes
Custom tag = imgpop
Menu description = Image Popper
User prompt hint = Enter full image URL.
Matching regex = (.+?)
Resulting markup =
Quote:
<a href="http://www.fccuk.org/forum/imagepopup.php?image=\\1" onclick="window.open('http://www.EXAMPLE.COM/FORUM/imagepopup.php?image=\\1', 'imagepopup', 'toolbar=no,scrollbars=no,width=300,height=300'); return false;"><img src="\\1" style="border: 1px solid black; padding: 5px;" height="60" vspace="5" alt="click to enlarge"></a>


NOTE
You should replace "EXAMPLE.COM/FORUM" with your own UBB URL. (In here it would be "ubbdev.com/forums".)

Usage
Use it on your Forum by using the Media button in your post/edit box and select "Image Popper".

Straight code:
Quote:
[imgpop]full url to my image[/imgpop]


Development phase
This has been tested to work with most image hosts. Although it should work 100%, I'll update when there's something annoying that needs a fix. Or when I get suggestions...

Demo
http://www.fccuk.org/forum/ubbthreads.php?ubb=showflat&Number=770874#Post770874
_________________________
- www.fiatcoupe.net -

Top
#317809 - 02/12/09 01:18 PM Re: [7.4.2] - UBB ImagePopper (incl. custom tag) [Re: Kayjey]
AllenAyres Offline

I type Like navaho

Registered: 03/10/00
Posts: 25580
Loc: Texas
Very nice Kayjey! Thank you for sharing! thumbsup
_________________________
- Allen wavey
- What Drives You?

Top
#317810 - 02/12/09 04:38 PM Re: [7.4.2] - UBB ImagePopper (incl. custom tag) [Re: AllenAyres]
DLWebmaestro Offline
Addict

Registered: 08/08/00
Posts: 1802
Loc: North Carolina
Sweet little toy you have there. Would there be a way to have all embedded images do this automatically?

Top
#317811 - 02/13/09 05:12 AM Re: [7.4.2] - UBB ImagePopper (incl. custom tag) [Re: DLWebmaestro]
Kayjey Offline
Newbie

Registered: 07/25/02
Posts: 12
Loc: Belgium, Zele
For that, you would have to alter the IMG tag parser. *might* be just a matter of editing bbcode.inc.php and convert the line

return sprintf('<img src="%s" %s alt="" />', $url, $align);

into

return sprintf('<a href="http://www.fccuk.org/forum/imagepopup.php?image=%s" onclick="window.open(\'http://www.EXAMPLE.COM/FORUM/imagepopup.php?image=%s\', \'imagepopup\', \'toolbar=no,scrollbars=no,width=300,height=300\'); return false;"><img src="%s" style="border: 1px solid black; padding: 5px;" height="60" vspace="5" alt="click to enlarge"></a>', $url, $align);

And upload the PHP script provided.

Am actually pretty sure you'll have to check out that "sprintf" thingy and take out the 'align' stuff AND/OR just make it so that images don't have the option of being floating. I'm sure someone else will jump in and give you a solution for this. I'm not going to try this out on my live board to be honest. For one thing, we don't allow inline images - only this image thumbnail thingy.


Edited by Kayjey (02/13/09 06:00 AM)
Edit Reason: correct last paragraph
_________________________
- www.fiatcoupe.net -

Top
#317812 - 02/13/09 05:31 AM Re: [7.4.2] - UBB ImagePopper (incl. custom tag) [Re: Kayjey]
Kayjey Offline
Newbie

Registered: 07/25/02
Posts: 12
Loc: Belgium, Zele
In fact you could just go into standard_text_editor.tpl and edit the line below "{if $allow_images}"

instead of

onclick="showHTML('image','image-drop')";

just put

onclick="DoPrompt('bbcode','Enter full image URL.','[imgpop]','[/imgpop]');"



Do mind I suspect an error in the $allow_images code somewhere as the button is ALWAYS show regardless of permissions. Also any checks on total number of images will be GONE as you're no longer using the IMG tag this is checked against. Also users that aren't allowed to insert images will still be able to do it through the imgpop tag. But it's a quick and easy edit to make like this. wink
_________________________
- www.fiatcoupe.net -

Top



Moderator:  sirdude 
Latest Posts
[7.2.1] - Naked shoutbox
by bellaonline
05/05/12 05:00 PM
[7.x] Stop Forum Spam Integration v0.4
by bellaonline
05/05/12 03:53 PM
Shout Box

(Views)Popular Topics
Known public proxy servers 1689885
Integrated Index Page (IIP) 5.3.1 555705
Finished-[6.5.2] Games Arcade Deluxe v1.9 501236
Integrated Index Page (IIP) 5.1.1 415112
TLD Bv2.1 Released - Threads Links Directory 396822
[6.0x] Who's Online 4.0.0 [Finished] 389412
Finished-[6.5.1] Integrated Index Page (IIP) 6.5 330423
Q & A 298663
Slash UBB 266936
[6.3.x] [beta] Hit Hack 2.0 227970
Forum Stats
13621 Members
59 Forums
37191 Topics
295716 Posts

Max Online: 686 @ 06/28/07 07:04 AM

 

 

 
fusionbb message board php hacks